package com.sm.service.impl;

import com.sm.mapper.UserMapper;
import com.sm.pojo.TbUser;
import com.sm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author 咕唧
 * @Date 2022/5/23 11:45
 * @Version 1.0
 */
@Service
@Transactional//注解控制事务
public class UserServiceImpl implements UserService {

    private UserMapper userMapper;

    @Autowired//自动填充对象属性
    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public TbUser findById(Long id) {
        return userMapper.findById(id);
    }
}
